#include "abstractdata.h"

AbstractData::AbstractData(QObject *parent) :
    AbstractModelItem(parent)
{
}

AbstractData::AbstractData(const AbstractData &other) :
    AbstractModelItem(other)
{
}

int AbstractData::fieldCount() const
{
    MetaDataPtr meta = metaData();
    if (meta.isNull()) return 0;

    return meta->items().count();
}

QVariant AbstractData::fieldName(int index) const
{
    MetaDataPtr meta = metaData();
    if (meta.isNull()) return QVariant();

    MetaItem* item = meta->item(index);
    if (!item) return QVariant();

    return item->field();
}


void AbstractData::onInitialize()
{
}

